<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">

	<title>OBNetworkDelegate Protocol Reference</title>

	<link rel="stylesheet" href="../css/style.css">
	<meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
	<meta name="generator" content="appledoc 2.2.1 (build 1334)">
</head>
<body class="appledoc">
	<header>
		<div class="container" class="hide-in-xcode">
			
			<h1 id="library-title">
				<a href="../index.html">OBMessenger </a>
			</h1>

			<p id="developer-home">
				<a href="../index.html">On-Bright</a>
			</p>
			
		</div>
	</header>

	<aside>
		<div class="container">
			<nav>
				<ul id="header-buttons" role="toolbar">
					<li><a href="../index.html">Index</a></li>
<li><a href="../hierarchy.html">Hierarchy</a></li>

					<li id="on-this-page" role="navigation">
						<label>
							On This Page

							<div class="chevron">
								<div class="chevy chevron-left"></div>
								<div class="chevy chevron-right"></div>
							</div>

							<select id="jump-to">
	<option value="top">Jump To&#133;</option>
	

	
	
	<option value="tasks">Tasks</option>
	
	

	
	

	

	
	<optgroup label="Instance Methods">
		
		<option value="//api/name/networkDiscoverState:withTimeOut:withMsg:">- networkDiscoverState:withTimeOut:withMsg:</option>
		
		<option value="//api/name/networkFoundLocalServer:">- networkFoundLocalServer:</option>
		
		<option value="//api/name/networkHasChangeToLocalServer:">- networkHasChangeToLocalServer:</option>
		
	</optgroup>
	
	
</select>
						</label>
					</li>
				</ul>
			</nav>
		</div>
	</aside>

	<article>
		<div id="overview_contents" class="container">
			<div id="content">
				<main role="main">
					<h1 class="title">OBNetworkDelegate Protocol Reference</h1>

					
					<div class="section section-specification"><table cellspacing="0"><tbody>
						<tr>
	<th>Conforms to</th>
	<td>NSObject</td>
</tr><tr>
	<th>Declared in</th>
	<td>OBNetwork.h</td>
</tr>
						</tbody></table></div>
					

                    

					
					
					<div class="section section-tasks">
						<a title="Tasks" name="tasks"></a>
						

						
						

						<div class="task-list">
							<div class="section-method">
	<a name="//api/name/networkFoundLocalServer:" title="networkFoundLocalServer:"></a>
	<h3 class="method-title"><code><a href="#//api/name/networkFoundLocalServer:">&ndash;&nbsp;networkFoundLocalServer:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>enable when set searchLocalServer to YES
ask OBManger whether change server and do network reload</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)networkFoundLocalServer:(nonnull NSString *)<em>localServer</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>localServer</code></th>
						<td><p>discovered local Server IP</p></td>
					</tr>
				
				</table>
			</div>
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBNetwork.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/networkHasChangeToLocalServer:" title="networkHasChangeToLocalServer:"></a>
	<h3 class="method-title"><code><a href="#//api/name/networkHasChangeToLocalServer:">&ndash;&nbsp;networkHasChangeToLocalServer:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>if change useLocalServer ,the called back will response</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)networkHasChangeToLocalServer:(BOOL)<em>enable</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>enable</code></th>
						<td><p>using localServer?</p></td>
					</tr>
				
				</table>
			</div>
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBNetwork.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/networkDiscoverState:withTimeOut:withMsg:" title="networkDiscoverState:withTimeOut:withMsg:"></a>
	<h3 class="method-title"><code><a href="#//api/name/networkDiscoverState:withTimeOut:withMsg:">&ndash;&nbsp;networkDiscoverState:withTimeOut:withMsg:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<ul>
<li>discoverDevice</li>
</ul>


<p>example
        if (!searching) {
        if (sec>0) {
        //total process time
        }
        if (sec==0&amp;&amp;msg) {
        //end discover
        if ([msg hasPrefix:NSLocalizedString(msgDisLinkPref, nil)]) {
        //link to OBOX
        }
        if ([msg hasPrefix:NSLocalizedString(msgDisCountPref, nil)]) {
        //count
        }
        }
        if (sec==-1&amp;&amp;msg) {
        if ([msg isEqualToString:NSLocalizedString(msgDisNoFound, nil)]) {
        //count 0
        }
        if ([msg isEqualToString:NSLocalizedString(msgDisNetErr, nil)]) {
        //net err
        }
        }
        }else{
        if (sec==0&amp;&amp;nil!=msg) {
        //found new host
        if ([msg hasPrefix:NSLocalizedString(msgDisGetOboxIpPref, nil)]) {
        NSString <em>ip = [msg stringByReplacingOccurrencesOfString:
        NSLocalizedString(msgDisGetOboxIpPref, nil)
        withString:@&ldquo;&rdquo;];
        //obox host
        }
        if ([msg hasPrefix:NSLocalizedString(msgDisGetCamIpPref, nil)]) {
        NSString </em>info = [msg stringByReplacingOccurrencesOfString:
        NSLocalizedString(msgDisGetCamIpPref, nil)
        withString:@&ldquo;&rdquo;];
        //camera host
        NSArray * infos = [info componentsSeparatedByString:@&ldquo;|&rdquo;];
        NSString * ip = infos[0];
        NSString * mac = infos[1];
        BOOL activate = [infos[2] int];
        }</p>

<pre><code>    }else{
    //process
    }
    }
</code></pre>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)networkDiscoverState:(BOOL)<em>searching</em> withTimeOut:(double)<em>sec</em> withMsg:(nullable NSString *)<em>msg</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>searching</code></th>
						<td><p>is searching or not</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>sec</code></th>
						<td><p>when searching is NO, timeout of the process; yes is the Elapsed time | 0: finish, -1: err</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>msg</code></th>
						<td><p>searching will be nil, when sec is -1 mean err, 0 mean count msg</p></td>
					</tr>
				
				</table>
			</div>
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">OBNetwork.h</code></p>
			</div>
			
			
		</div>
	</div>
</div>
						</div>
						
					</div>
					
					

                    
                    
          
				</main>

				<footer>
					<div class="footer-copyright">
						
						<p class="copyright">Copyright &copy; 2017 On-Bright. All rights reserved. Updated: 2017-06-09</p>
						
						
						<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
						
					</div>
				</footer>
			</div>
		</div>
	</article>

	<script src="../js/script.js"></script>
</body>
</html>